package validator.annotation;


import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import validator.RegisterRequestValidator;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.PARAMETER, ElementType.FIELD})  // 作用在字段或参数上
@Retention(RetentionPolicy.RUNTIME)                  // 运行时生效
@Constraint(validatedBy = RegisterRequestValidator.class)      // 指定校验器
public @interface ValidateRegisterRequest {
    String message() default "";          // 默认错误信息
    Class<?>[] groups() default {};                  // 分组校验支持
    Class<? extends Payload>[] payload() default {}; // 校验载荷
}
